from utils.models import BaseModel
from django.db import models
class Area(models.Model):
    """ 省市区 """
    name = models.CharField(max_length=20, verbose_name='名称')
    # related_name =
    parent = models.ForeignKey('self', on_delete=models.SET_NULL, related_name='subs', verbose_name='上级行政区', null=True, blank=True)

    class Meta:
        db_table = 'tb_areas'
        verbose_name = '省市区'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
